package com.example.service;

import com.example.mapper.Usermapper;
import com.example.user.user;
import com.example.util.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class Userservice {

    @Resource
    private Usermapper usermapper;
    public Result login( String username, String password) {
        String Username = usermapper.query(username);
        String Password = usermapper.query1(password);
        if (Username==null){
            return  Result.username_error();
        }
        if(Username.equals(username)){
            if (Password.equals(password)){
                return Result.success();

            }
        }else {
            return Result.register_error();
        }

        return Result.password_error();


    }
}
